///////////////////////////////////////////////////////////
//  Page.h
//  Implementation of the Class Page
//  Created on:      21-Aug-2013 11:05:05 PM
//  Original author: Jakkaphan Aiemcharoenjit
///////////////////////////////////////////////////////////

#if !defined(EA_DB9CF0F3_EA66_4c90_B569_B9CA96F33006__INCLUDED_)
#define EA_DB9CF0F3_EA66_4c90_B569_B9CA96F33006__INCLUDED_

#include "..\Interfaces\IPage.h"
#include <vector>

namespace Data
{
class Page : public IPage
{

public:
	Page(IPage::PageType _type = IPage::CHOICEPAGE_T);
	Page(const Page& anotherPage);
	virtual ~Page();
	virtual IObject::ObjectType GetType() const;
	virtual IPage::PageType GetPageType() const;
	virtual String_t GetName() const;
	virtual IObject* GetChild(unsigned int index) const;
	virtual String_t GetTemplateName() const;
	virtual String_t GetTitle() const;
	virtual IChoices* GetChoices() const;
	virtual String_t GetComment() const;
	virtual void AppendChild(IObject* item);
	virtual void InsertChild(unsigned int index, IObject* item);
	virtual IObject* RemoveChild(unsigned int index);
	virtual int CountChilds() const;
	virtual void SetName(const String_t& name);
	virtual void SetTemplateName(const String_t& name);
	virtual void SetTitle(const String_t& title);
	virtual void SetComment(const String_t& comment);
	virtual void SetPageType(IPage::PageType pageType);
  virtual void SetPageType(const String_t& pageType);
  virtual void SetChoices(IChoices* choices);
	virtual IObject* Clone();
	virtual String_t ToXML();
  virtual IObject* operator[](unsigned int index);
	virtual IObject* GetParent();
	virtual void SetParent(IObject* parent);
  virtual void ClearItems();
  virtual void CopyPage(IPage* tempPage);
  virtual void UpdateTemplateTime();
  virtual void UpdateBuildTime();
  virtual void SetTemplateTime(String_t datetime);
  virtual void SetBuildTime(String_t datetime);
  virtual String_t GetTemplateTime() const;
  virtual String_t GetBuildTime() const;

private:
  String_t PageTypeDesc();

private:
	IObject::ObjectType m_type;
  std::vector<IObject*> m_childs;
  IPage::PageType m_pageType;
	String_t m_name;
	IChoices* m_choices;
	String_t m_templateName;
	String_t m_comment;
	String_t m_title;
	IObject* m_parent;
  String_t m_templateTime;
  String_t m_buildTime;
};
}
#endif // !defined(EA_DB9CF0F3_EA66_4c90_B569_B9CA96F33006__INCLUDED_)
